#include <iostream>
#include <map>
#include <math.h>
#include <windows.h>
using namespace std;
map<string,string> smap;
map<string,int> wmap;


void prepare() {
	smap[".-"] = "A";
	smap["-..."] = "B";
	smap["-.-."] = "C";
	smap["-.."] = "D";
	smap["."] = "E";
	smap["..-."] = "F";
	smap["--."] = "G";
	smap["...."] = "H";
	smap[".."] = "I";
	smap[".---"] = "J";
	smap["-.-"] = "K";
	smap[".-.."] = "L";
	smap["--"] = "M";
	smap["-."] = "N";
	smap["---"] = "O";
	smap[".--."] = "P";
	smap["--.-"] = "Q";
	smap[".-."] = "R";
	smap["..."] = "S";
	smap["-"] = "T";
	smap["..-"] = "U";
	smap["...-"] = "V";
	smap[".--"] = "W";
	smap["-..-"] = "X";
	smap["-.--"] = "Y";
	smap["--.."] = "Z";
	smap[".----"] = "1";
	smap["..---"] = "2";
	smap["...--"] = "3";
	smap["....-"] = "4";
	smap["....."] = "5";
	smap["-...."] = "6";
	smap["--..."] = "7";
	smap["---.."] = "8";
	smap["----."] = "9";
	smap["-----"] = "0";
	smap[".-.-.-"] = ".";
	smap["--..--"] = ",";
	smap["---..."] = ":";
	smap["-.-.-."] = ";";
	smap["..--.."] = "?";
	smap["-...-"] = "=";
	smap[".----."] = "'";
	smap["-..-."] = "/";
	smap["-.-.--"] = "!";
	smap["-....-"] = "-";
	smap["..--.-"] = "_";
	smap[".-..-."] = "~";
	smap["-.--."] = "(";
	smap["-.--.-"] = ")";
	smap["...-..-"] = "$";
	smap[".--.-."] = "@";
	return;
}


int main() {
	prepare();
	int success=0;
	while(true) {
		int len=rand()%6;
		if(len == 0)
			continue;
		string s="";
		for(int i=0; i<len; i++)
			s += rand()%2==1?".":"-";
		cout<<s<<endl;
		string input;
		cin>>input;
		if(input == "QQ")
			break;
		if(smap[s] == "") {
			if(input == "NN") {
				cout<<"yes"<<endl;
				success++;
			} else {
				cout<<"no,it's empty!"<<endl;
				wmap[s]++;
			}
		} else {
			if(input == smap[s]) {
				cout<<"yes"<<endl;
				success++;
			} else {
				cout<<"no,it's "<<smap[s]<<endl;
				wmap[smap[s]]++;
			}
		}
	}
	cout<<"success:"<<success<<endl;
	map<string, int>::iterator iter;
	for (iter = wmap.begin(); iter != wmap.end(); iter++) {
		cout << iter->first << ":" << iter->second << endl;
	}
	system("pause");
	return 0;
}
